#ifndef _PBUFFER_H_
#define _PBUFFER_H_

#include "ARB_extensions.h"
#include "context.h"
#include "../shapes.h"
#include "viewport.h"

class CPbuffer
{
private:
	HPBUFFERARB _buffer;
	unsigned int _texID;
	CContext _ctx;
	SRect _rct;

public:
	CPbuffer(int width, int height) : _texID(0), _buffer(NULL), _rct(0, 0, width, height), _ctx() {}
	~CPbuffer();
	BOOL init();
	BOOL enable(const SRect* rect = NULL);
	BOOL disable(const CViewport& vp);
	void bind(void);
	void release(void);
};

#endif //_PBUFFER_H_